type hint cheatsheet
- description
- No value
- aliases
- No value
- tags
- No value
- created
- 2023-05-17T17:31:36
- updated
- 2023-07-15T21:33:03
- title
- type hint cheatsheet
# A generator function that yields ints is secretly just a function that
# returns an iterator of ints, so that's how we annotate it
def gen(n: int) -> Iterator[int]:
i = 0
while i < n:
yield i
i += 1